package com.lpb.spring.test1.factory.config;

import com.google.common.collect.Maps;

import java.util.Map;

/**
 * @author linpengbo
 * @date 2022/4/27
 */
public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {

    private static final Map<String,Object> singletonBeanMap= Maps.newConcurrentMap();

    @Override
    public Object getSingleton(String beanName) {
        return singletonBeanMap.get(beanName);
    }

    protected void addSingletonBean(String beanName,Object bean){
        singletonBeanMap.put(beanName,bean);
    }

}
